import req from '../http'
// 侧边栏的全部请求
export function user(data) {
    return  req({
        url: '/customer/api/tbClient/selectOneTbUser/'+data.username,method: 'get',
    })
}

// 查询额度
export function bag() {
    return  req({
        url: '/customer/api/tbClient/selectMoney/',
        method: 'post',
    })
}

//充值
export function addmoney(data) {
    return req({
        url: '/customer/api/tbClient/addMoney/' + data.amount + '/' + data.name + '/' + data.integration,
        method: 'post',
    })
}

// 支付
export function pay(data){
    return req({
        url:'/api/mbs/order/insertOrder',
        method:'post',
        data:data
    })
}

// 检验密码
export function checkPwd(data){
    return req({
        url:'/customer/api/tbClient/selectPassword/'+data.username+'/'+data.password,
        method:'post'
    })
}

// 修改密码
export function changePwd(data){
    return req({
        url:'/customer/api/tbClient/updatePassword/'+data.username+'/'+data.password, method:'post'
    })
}

// 找回密码
export function backPwd(data){
    return req({
        url:'/mbs/client/BackPwd',
        method:'post',
        data:data
    })

}

// 完善个人资料
export function userdataFun(data){

    return req({
        url:'/customer/api/tbClient/updateUserOver/', method:'post', data:data
    })

}

// 上传图片
export function uploadImg(data){
    return req({
        url:'http://192.168.1.195:8000/upload/ossfile/customer-image',
        method:'post',
        data:data
    })
}

//删除redis存储的登录信息
export function deleteLogin(){
    return req({
        url:'/login/account/logout' , method:'get'
    })
}

// 修改图片
export function uploadImgMember(data){
    return req({
        url:'/customer/api/tbClient/updateHeadPic/',data,method:'post',

    })
}

// 二维码
export function getNativeCodeUrl(data){
    return req({ url:'/customer/api/createNative/',method:'post',data: data,
    })
}

// 我的订单充值二维码
export function getWNativeCodeUrl(data){
    return req({ url:'/customer/api/createNativetwo/'+data.amount+'/'+data.uid,method:'post'
    })
}


export function  getZFBativeCodeUrl(data){
    return  req({ url:'/customer/api/createNativeThree/'+data.amount+'/'+data.uid,method:'post'})
}

//验证是否支付（微信）
export function queryPayStatus(data){
    return req({ url:'/customer/api/charge/getPayStatus/'+data.id, method:'get',
    })
}
//验证订单中是否支付（微信）
export function queryPayStatusTWo(data){
    return req({ url:'/customer/api/charge/getPayStatusTwo/'+data.id, method:'post',
    })
}
//验证支付宝是否支付
export  function  queryPayStatustwo(data){
    return req({ url:'/customer/api/charge/getPayStatusTwo/'+data.id, method:'get',})
}


//支付宝支付生成二维码
export function getZFBNativeCodeUrl(data){
    return req({
        url:'/customer/api/charge/getZFBNativeCodeUrl/',data:data, method:'post'
    })
}

//查询订单
export function queryByMemberId(data){
    return req({
        url:'/system/api/order/selectOrderByStatus/'+data.statu,
        method:'post'
    })
}
// 订单二维码
export function getNativeCodeUrl2(data){

    return req({
        //url:'/order/getNativeCodeUrl?preparidAmount='+data.preparidAmount+"&memberId="+data.memberId,
        url:'/system/api/order/VXPay',
        method:'post',
        data: data
    })
}
//验证是否支付（微信）
export function queryPayStatus2(data){

    return req({
        url:'/system/api/order/isOrder',
        method:'post',
        data:data
    })
}
//下单
export function addorder(data){
    return req({
        url:'/order/addMoney',
        method:'post',
        data:data
    })
}
//下单寻找优惠卷
export function useCoupon(data){
    return req({
        url:'/order/queryAvailableCoupon?memberId='+data.memberId+'&shopId='+data.shopId,
        method:'get'
    })
}
//用户金额下单
export function useAmount(data){
    return req({
        url:'/rent/order/insertOreder',
        method:'post',
        data:data
    })
}
//用户取消下单
export function closeOrder(data){
    return req({
        url:'/system/api/order/updateOrderStart',
        method:'post',
        data:data
    })
}

//查询充值订单
export function queryAccountOrderByMemberId(data){
    return req({
        url:'/customer/api/charge/'+data.pageNo+"/"+data.pageSize,
        method:'get',
        data: data
    })
}

//充值订单取消支付
export function accountOrderCancel(data){
    return req({
        url: '/customer/api/charge/setPaystatus/'+data.id, method: 'post',
    })
}
